package com.design.designmode.struct.decorate;

/**
 * @author hxl
 * @since 2023-04-17
 */
public class Main {
    public static void main(String[] args) {
        Person zhangsan = new Student("张三");
        zhangsan = new DecoratorA(zhangsan);
        zhangsan = new DecoratorB(zhangsan);
        zhangsan.operate();

        System.out.println("\n=====我是分割线=====");

        // 对象链
        Person lisi = new DecoratorA(new DecoratorB(new Student("李四")));
        lisi.operate();
    }
}
